#ifndef ELEMENTS_PHASE_H
#define ELEMENTS_PHASE_H

#include <ctime>

#include "element.h"

namespace Elements
{

struct Phase : public Element
{
    Phase() = default;
    Phase(const Phase& other);

    // -- Интерфейс элемента -- //

    virtual bool isSame(Element* other) const override;

    virtual Common::Json toJson() const override;
    virtual void fromJson(const Common::Json& json) override;

    virtual Element* clone() const override;
    virtual ElementType elementType() const override;

    // -- Интерфейс данных -- //

    unsigned projectId() const;
    void setProjectId(unsigned value);

    std::string caption() const;
    void setCaption(const std::string& value);

    std::string description() const;
    void setDescription(const std::string& value);

    std::string searchCaption() const;
    void setSearchCaption(const std::string& value);

    std::string searchDescription() const;
    void setSearchDescription(const std::string& value);

    std::time_t beginDate() const;
    void setBeginDate(const std::time_t& value);

    std::time_t endDate() const;
    void setEndDate(const std::time_t& value);

private:
    unsigned m_projectId = 0;
    std::string m_caption;
    std::string m_description;
    std::string m_searchCaption;
    std::string m_searchDescription;
    std::time_t m_beginDate = 0;
    std::time_t m_endDate = 0;
};

typedef std::shared_ptr<Phase> PhasePtr;
typedef std::vector<PhasePtr> Phases;

} // namespace Elements

#endif // ELEMENTS_PHASE_H
